/*
 * Copyright (c) 2016 太阳花互动科技. All Rights Reserved.
 */
package com.yhyvr.api.controller.message;


import com.yhyvr.api.handle.ApiData;
import com.yhyvr.api.service.store.ApiMessageService;
import com.yhyvr.api.tool.ViewFactory;
import com.yhyvr.pojo.req.api.ApiReqBody;
import com.yhyvr.pojo.req.api.ApiReqData;
import com.yhyvr.pojo.req.api.message.ApiMessageReq;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * 
* @ClassName: BannerController 
* @Description: banner列表
* @author zhangqin
* @date 2016年4月29日 下午3:25:22 
*
 */
@Controller
public class ApiMessageController {
	@Resource
	private ApiMessageService apiMessageService;
	@RequestMapping("/api/store/message/list")
	public @ResponseBody
	ModelAndView messageList(@ApiData(h5Visit=true,h5VisitToken = false) ApiReqData<ApiReqBody> apiReqData){
		return ViewFactory.buildApiJsonpView(apiMessageService.messageList(apiReqData),apiReqData.getCrossDomain());
	}

	@RequestMapping("/api/store/message/detail")
	public @ResponseBody
	ModelAndView messageDetail(@ApiData(h5Visit=true,h5VisitToken = false) ApiReqData<ApiMessageReq> apiReqData){
		return ViewFactory.buildApiJsonpView(apiMessageService.messageDetail(apiReqData),apiReqData.getCrossDomain());
	}
}
